package com.rf.HelloSpringBoot.Utils;

import com.rf.HelloSpringBoot.domain.Result;

/**
 * 返回结果统一处理
 * @author linzhengchun
 *
 * 2017年8月1日 上午10:16:12
 */
public class ResultUtil {

	public static Result success(Object object) {
		Result result = new Result();
		result.setCode(0);
		result.setMsg("success");
		result.setData(object);
		
		return result;
	}
	
	public static Result success() {
		return ResultUtil.success(null);
	}
	
	public static Result error(Integer code, String msg) {
		Result result = new Result();
		result.setCode(code);
		result.setMsg(msg);
		
		return result;
	}
}
